package com.anlogic.sdk.bsp.settings;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

public class Component {
	private List<String> descriptions = new ArrayList<String>();

	private List<String> versions = new ArrayList<String>();

	private boolean enabled = false;

	private int selectedVersion = 0;

	private String name;

	public void setName(String name) {
		this.name = name;
	}

	public String getName() {
		return this.name;
	}

	public void addVersion(String version) {
		this.versions.add(version);
	}

	public void addVersions(String[] versions) {
		this.versions.addAll(Arrays.asList(versions));
	}

	public List<String> getVersions() {
		return this.versions;
	}

	public void addDescriptions(String[] descriptions) {
		this.descriptions.addAll(Arrays.asList(descriptions));
	}
	
	public void addDescription(String description) {
		this.descriptions.add(description);
	}

	public List<String> getDescriptions() {
		return this.descriptions;
	}

	public void setEnabled(boolean enabled) {
		this.enabled = enabled;
	}

	public boolean isEnabled() {
		return this.enabled;
	}

	public void setSelectedVersion(int selectedVersion) {
		this.selectedVersion = selectedVersion;
	}

	public void setSelectedVersion(String version) {
		for (int i = 0; i < this.versions.size(); i++) {
			String s = this.versions.get(i);
			if (s.equals(version))
				this.selectedVersion = i;
		}
	}

	public int getSelectedVersion() {
		return this.selectedVersion;
	}

	public String getSelectedVersionString() {
		return this.versions.get(this.selectedVersion);
	}
}
